﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddExtAttribute.aspx.cs" Inherits="Com.CMS263.Web.manage.ManageArtType.AddExtAttribute" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <link href="../style/main.css" rel="stylesheet" type="text/css" />
     <link href="../style/style.css" rel="Stylesheet" type="text/css" />
    <link href="../common/validator.css" rel="stylesheet" type="text/css" />
     <script src="../js/pager.js" type="text/javascript"></script>
    <script type ="text/javascript" language="javascript" src="../js/jquery-1.4.2.min.js"></script>
    <script language ="javascript" type ="text/javascript" >
        $(function() {
        $("#tab tbody tr").mouseover(function() {
        $("#tab tbody tr").attr("className", "asd02")
                $(this).attr("className", "asd01")
            })
        })
        function del(id, obj) {
            if (confirm('确认删除此条记录')) {
                $.post("DelExtAttribute.ashx", { id: id }, function(data) {
                    if (data == "ok") {
                        alert('删除成功');
                        $(obj.parentNode.parentNode).remove();
                    }
                    if (data == "you") {
                        alert('该属性在内容里有使用,请删除相关内容后在删除此属性！');
                    }
                })
            }
        }
    </script>
    <style type="text/css">
        .style2
        {
            width: 144px;
        }
        .style3
        {
            width: 92px;
        }
        .style4
        {
            width: 62px;
        }
        .style5
        {
            width: 67px;
        }
        .style6
        {
            width: 69px;
        }
        .style7
        {
            width: 147px;
        }
    </style>
</head>
<body style="background-color: #ffffff;">
    <form id="form1" runat="server">
    <div style=" font-size:12px">
   添加 <b> <asp:Label ID="typeName" runat="server"></asp:Label></b> 扩展属性：</br>
        <table style="width:100%;" id="tab" border="0" cellspacing="0" cellpadding="0" class="n_dstable">
        <thead class="data_th">
            <tr>
            <td>编号</td>
                <td class="style3">
                    属性中文名</td>
                <td class="style4">
                    属性名</td>
                <td class="style5">
                    属性类型</td>
                <td class="style6">
                    不能为空</td>
                <td class="style7">
                    在后台列表显示</td>
                <td>
                    默认值</td>
                    <td>
                    操作</td>
                    
            </tr>
            </thead>
        <tbody class="data_tb">
            <asp:Repeater runat="server" ID="ext">
            <ItemTemplate>
           
            
         <tr>
         <td><%#Eval("id") %></td>
                <td class="style3">
                   <%#Eval("attrTxtName") %></td>
                <td class="style4">
                    <%#Eval("attrName") %></td>
                <td class="style5">
                   <%#Eval("attrType") %></td>
                <td class="style6">
                    <%#Convert.ToInt32(Eval("notNull"))==1?"是":"否" %></td>
                <td class="style7">
                   <%#Convert.ToInt32(Eval("showInBack"))==1?"是":"否" %></td>
                <td>
                   <%#Eval("defaultValue") %></td>
                   <td >
                   <input type="button" class="btn4_out" onmouseover="this.className='btn4_over'" onmouseout="this.className='btn4_out'" onclick="javascript:window.location.href='EditExtAttribute.aspx?id=<%#Eval("id") %>'" value="编辑" />
                   <input type="button" class="btn4_out" onmouseover="this.className='btn4_over'" onmouseout="this.className='btn4_out'" onclick="del(<%#Eval("id") %>,this)" value="删除" />
                 
                   </td>
            </tr>
            </ItemTemplate>
            </asp:Repeater>
            </tbody>
        </table>
        <br />
    
        <table style="width:100%;" border="0" align="center" cellpadding="5" cellspacing="5" class="table_1">
            <tr>
                <td  style=" text-align:right" class="style2">
                    属性中文名：<br />
                    （页面上显示的名字）</td>
                <td style ="text-align :left ;">
                    <asp:TextBox ID="txtAttrTxtName" runat="server" Width="189px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td  style="text-align:right" class="style2">
                    属性名：<br />
                    (用于程序)</td>
                <td style ="text-align :left ;">
                    <asp:TextBox ID="txtAttrName" runat="server" Width="189px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td  style="text-align:right" class="style2">
                    属性类型：</td>
                <td style ="text-align :left ;">
                    <asp:DropDownList ID="ddlAttrType" runat="server" 
                        onselectedindexchanged="ddlAttrType_SelectedIndexChanged">
                    <asp:ListItem Value="1">单行文本框</asp:ListItem>
                    <asp:ListItem Value="2">多行文本框</asp:ListItem>
                    <asp:ListItem Value="3">在线编辑器</asp:ListItem>
                    <asp:ListItem Value="4">上传图片</asp:ListItem>
                    <asp:ListItem Value="5">上传文件</asp:ListItem>
                    <asp:ListItem Value="6">单选框</asp:ListItem>
                    <asp:ListItem Value="7">多选框</asp:ListItem>
                    <asp:ListItem Value="8">下拉框</asp:ListItem>
                    <asp:ListItem Value="9">超链接(用于链接其他表的数据)</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td  style="text-align:right" class="style2">
                    可选值：</td>
                <td style ="text-align :left ;">
                    <asp:TextBox ID="txtAttrValue" TextMode="MultiLine" runat="server" Width="401px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td  style="text-align:right" class="style2">
                    不能为空：</td>
                <td style ="text-align :left ;">
                    <asp:CheckBox ID="chkNotNull" runat="server" />
                </td>
                
            </tr>
            <tr>
                <td  style="text-align:right" class="style2">
                    在后台列表中显示：</td>
                <td style ="text-align :left ;">
                    <asp:CheckBox ID="chkShowInBack" runat="server" />
                </td>
            </tr>
            <tr>
                <td  style="text-align:right" class="style2">
                    默认值：</td>
                <td style ="text-align :left ;">
                    <asp:TextBox ID="defaultValue" runat="server" Width="401px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td  style="text-align:right" class="style2">
                    排序编号：</td>
                <td style ="text-align :left ;">
                    <asp:TextBox ID="txtOrderNum" runat="server" Width="52px">0</asp:TextBox>
                </td>
            </tr>
            <tr>
                <td  style="text-align:right" class="style2">
                    &nbsp;</td>
                <td style ="text-align :left ;">
                    <asp:HiddenField ID="hdfTypeId" runat="server" />
                    <asp:Button ID="Button1" runat="server" Text="添加" onclick="Button1_Click" />
                </td>
            </tr>
        </table>
    
    </div>
    </form>
</body>
</html>
